home *** CD-ROM | disk | FTP | other *** search
Unknown | 1999-12-08 | 7.8 KB |
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was not able to be converted.
This format is not currently supported by dexvert.
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 05 43 6c 61 73 73 09 4e | 65 74 43 61 6e 76 61 73 |.Class.N|etCanvas|
|00000010| 20 89 01 b5 0b ae 08 07 | 00 09 4e 65 74 43 61 6e | .......|..NetCan|
|00000020| 76 61 73 a8 02 06 43 61 | 6e 76 61 73 00 10 10 6c |vas...Ca|nvas...l|
|00000030| 69 6e 6b 73 28 30 29 20 | 61 73 20 6c 69 6e 6b 00 |inks(0) |as link.|
|00000040| 10 6e 6f 64 65 73 28 30 | 29 20 61 73 20 6e 6f 64 |.nodes(0|) as nod|
|00000050| 65 00 0e 6f 66 66 20 61 | 73 20 70 69 63 74 75 72 |e..off a|s pictur|
|00000060| 65 00 10 62 67 63 6f 6c | 6f 72 20 61 73 20 63 6f |e..bgcol|or as co|
|00000070| 6c 6f 72 00 12 6c 69 6e | 6b 63 6f 6c 6f 72 20 61 |lor..lin|kcolor a|
|00000080| 73 20 63 6f 6c 6f 72 00 | 12 6e 6f 64 65 63 6f 6c |s color.|.nodecol|
|00000090| 6f 72 20 61 73 20 63 6f | 6c 6f 72 00 10 6d 79 66 |or as co|lor..myf|
|000000a0| 6f 6e 74 20 61 73 20 73 | 74 72 69 6e 67 00 12 73 |ont as s|tring..s|
|000000b0| 65 6c 6e 6f 64 65 20 61 | 73 20 69 6e 74 65 67 65 |elnode a|s intege|
|000000c0| 72 00 12 73 65 6c 6c 69 | 6e 6b 20 61 73 20 69 6e |r..selli|nk as in|
|000000d0| 74 65 67 65 72 00 10 6c | 61 73 74 78 20 61 73 20 |teger..l|astx as |
|000000e0| 69 6e 74 65 67 65 72 00 | 10 6c 61 73 74 79 20 61 |integer.|.lasty a|
|000000f0| 73 20 69 6e 74 65 67 65 | 72 00 15 6c 61 73 74 63 |s intege|r..lastc|
|00000100| 6c 69 63 6b 65 64 20 61 | 73 20 64 6f 75 62 6c 65 |licked a|s double|
|00000110| 00 14 6e 65 61 74 6c 69 | 6e 6b 73 20 61 73 20 62 |..neatli|nks as b|
|00000120| 6f 6f 6c 65 61 6e 00 16 | 6c 69 6e 6b 74 65 78 74 |oolean..|linktext|
|00000130| 63 6f 6c 6f 72 20 61 73 | 20 63 6f 6c 6f 72 00 13 |color as| color..|
|00000140| 65 64 69 74 6d 6f 64 65 | 20 61 73 20 62 6f 6f 6c |editmode| as bool|
|00000150| 65 61 6e 00 12 64 72 61 | 67 64 69 72 20 61 73 20 |ean..dra|gdir as |
|00000160| 69 6e 74 65 67 65 72 00 | 06 09 6d 79 72 65 66 72 |integer.|..myrefr|
|00000170| 65 73 68 00 00 00 0c 00 | 0c 00 12 0f 53 75 62 20 |esh.....|....Sub |
|00000180| 6d 79 72 65 66 72 65 73 | 68 28 29 10 64 69 6d 20 |myrefres|h().dim |
|00000190| 69 20 61 73 20 69 6e 74 | 65 67 65 72 00 1e 6f 66 |i as int|eger..of|
|000001a0| 66 2e 67 72 61 70 68 69 | 63 73 2e 66 6f 72 65 63 |f.graphi|cs.forec|
|000001b0| 6f 6c 6f 72 3d 62 67 63 | 6f 6c 6f 72 26 6f 66 66 |olor=bgc|olor&off|
|000001c0| 2e 67 72 61 70 68 69 63 | 73 2e 66 69 6c 6c 72 65 |.graphic|s.fillre|
|000001d0| 63 74 20 30 2c 30 2c 77 | 69 64 74 68 2c 68 65 69 |ct 0,0,w|idth,hei|
|000001e0| 67 68 74 20 6f 66 66 2e | 67 72 61 70 68 69 63 73 |ght off.|graphics|
|000001f0| 2e 66 6f 72 65 63 6f 6c | 6f 72 3d 6e 6f 64 65 63 |.forecol|or=nodec|
|00000200| 6f 6c 6f 72 00 18 66 6f | 72 20 69 3d 31 20 74 6f |olor..fo|r i=1 to|
|00000210| 20 75 62 6f 75 6e 64 28 | 6c 69 6e 6b 73 29 0a 64 | ubound(|links).d|
|00000220| 72 61 77 6c 69 6e 6b 20 | 69 04 6e 65 78 74 00 18 |rawlink |i.next..|
|00000230| 66 6f 72 20 69 3d 31 20 | 74 6f 20 75 62 6f 75 6e |for i=1 |to uboun|
|00000240| 64 28 6e 6f 64 65 73 29 | 0a 64 72 61 77 6e 6f 64 |d(nodes)|.drawnod|
|00000250| 65 20 69 04 6e 65 78 74 | 00 1c 67 72 61 70 68 69 |e i.next|..graphi|
|00000260| 63 73 2e 64 72 61 77 70 | 69 63 74 75 72 65 20 6f |cs.drawp|icture o|
|00000270| 66 66 2c 30 2c 30 00 07 | 45 6e 64 20 53 75 62 08 |ff,0,0..|End Sub.|
|00000280| 64 72 61 77 6c 69 6e 6b | 0e 6e 75 6d 20 61 73 20 |drawlink|.num as |
|00000290| 69 6e 74 65 67 65 72 00 | 00 0b 06 0b 06 a2 01 1c |integer.|........|
|000002a0| 53 75 62 20 64 72 61 77 | 6c 69 6e 6b 28 6e 75 6d |Sub draw|link(num|
|000002b0| 20 61 73 20 69 6e 74 65 | 67 65 72 29 35 64 69 6d | as inte|ger)5dim|
|000002c0| 20 78 31 2c 78 32 2c 79 | 31 2c 79 32 2c 62 2c 61 | x1,x2,y|1,y2,b,a|
|000002d0| 72 72 6f 77 2c 61 78 31 | 2c 61 79 31 2c 61 78 32 |rrow,ax1|,ay1,ax2|
|000002e0| 2c 61 79 32 2c 20 73 20 | 61 73 20 69 6e 74 65 67 |,ay2, s |as integ|
|000002f0| 65 72 1b 64 69 6d 20 6d | 2c 61 2c 20 70 69 2c 61 |er.dim m|,a, pi,a|
|00000300| 6e 67 6c 65 20 61 73 20 | 64 6f 75 62 6c 65 0d 64 |ngle as |double.d|
|00000310| 69 6d 20 6c 20 61 73 20 | 6c 69 6e 6b 0f 64 69 6d |im l as |link.dim|
|00000320| 20 66 2c 74 20 61 73 20 | 6e 6f 64 65 0c 6c 3d 6c | f,t as |node.l=l|
|00000330| 69 6e 6b 73 28 6e 75 6d | 29 0c 66 3d 6c 2e 66 72 |inks(num|).f=l.fr|
|00000340| 6f 6d 6e 6f 64 65 0a 74 | 3d 6c 2e 74 6f 6e 6f 64 |omnode.t|=l.tonod|
|00000350| 65 00 16 69 66 20 66 3d | 4e 69 6c 20 6f 72 20 74 |e..if f=|Nil or t|
|00000360| 3d 4e 69 6c 20 74 68 65 | 6e 06 72 65 74 75 72 6e |=Nil the|n.return|
|00000370| 06 65 6e 64 20 69 66 00 | 2e 62 3d 35 20 2f 2f 62 |.end if.|.b=5 //b|
|00000380| 75 66 66 65 72 20 62 65 | 74 77 65 65 6e 20 65 64 |uffer be|tween ed|
|00000390| 67 65 20 6f 66 20 6e 6f | 64 65 20 26 20 61 72 72 |ge of no|de & arr|
|000003a0| 6f 77 20 68 65 61 64 1f | 61 72 72 6f 77 3d 31 30 |ow head.|arrow=10|
|000003b0| 20 2f 2f 6c 65 6e 67 74 | 68 20 6f 66 20 61 72 72 | //lengt|h of arr|
|000003c0| 6f 77 20 62 61 72 73 0a | 70 69 3d 33 2e 31 34 31 |ow bars.|pi=3.141|
|000003d0| 35 39 2c 61 6e 67 6c 65 | 3d 70 69 2f 36 20 2f 2f |59,angle|=pi/6 //|
|000003e0| 61 6e 67 6c 65 20 62 65 | 74 77 65 65 6e 20 61 72 |angle be|tween ar|
|000003f0| 72 6f 77 20 62 61 72 73 | 20 26 20 6c 69 6e 65 00 |row bars| & line.|
|00000400| 13 69 66 20 73 65 6c 6c | 69 6e 6b 3d 6e 75 6d 20 |.if sell|ink=num |
|00000410| 74 68 65 6e 23 6f 66 66 | 2e 67 72 61 70 68 69 63 |then#off|.graphic|
|00000420| 73 2e 66 6f 72 65 63 6f | 6c 6f 72 3d 72 67 62 28 |s.foreco|lor=rgb(|
|00000430| 32 35 30 2c 30 2c 30 29 | 04 65 6c 73 65 21 6f 66 |250,0,0)|.else!of|
|00000440| 66 2e 67 72 61 70 68 69 | 63 73 2e 66 6f 72 65 63 |f.graphi|cs.forec|
|00000450| 6f 6c 6f 72 3d 72 67 62 | 28 30 2c 30 2c 30 29 06 |olor=rgb|(0,0,0).|
|00000460| 65 6e 64 20 69 66 00 21 | 6f 66 66 2e 67 72 61 70 |end if.!|off.grap|
|00000470| 68 69 63 73 2e 70 65 6e | 77 69 64 74 68 3d 6c 2e |hics.pen|width=l.|
|00000480| 74 68 69 63 6b 6e 65 73 | 73 22 6f 66 66 2e 67 72 |thicknes|s"off.gr|
|00000490| 61 70 68 69 63 73 2e 70 | 65 6e 68 65 69 67 68 74 |aphics.p|enheight|
|000004a0| 3d 6c 2e 74 68 69 63 6b | 6e 65 73 73 00 16 69 66 |=l.thick|ness..if|
|000004b0| 20 6e 6f 74 28 6e 65 61 | 74 6c 69 6e 6b 73 29 20 | not(nea|tlinks) |
|000004c0| 74 68 65 6e 10 78 31 3d | 66 2e 78 2b 66 2e 77 69 |then.x1=|f.x+f.wi|
|000004d0| 64 74 68 2f 32 11 79 31 | 3d 66 2e 79 2b 66 2e 68 |dth/2.y1|=f.y+f.h|
|000004e0| 65 69 67 68 74 2f 32 10 | 78 32 3d 74 2e 78 2b 74 |eight/2.|x2=t.x+t|
|000004f0| 2e 77 69 64 74 68 2f 32 | 11 79 32 3d 74 2e 79 2b |.width/2|.y2=t.y+|
|00000500| 74 2e 68 65 69 67 68 74 | 2f 32 04 65 6c 73 65 19 |t.height|/2.else.|
|00000510| 69 66 20 74 2e 78 20 3e | 20 66 2e 78 2b 66 2e 77 |if t.x >| f.x+f.w|
|00000520| 69 64 74 68 20 74 68 65 | 6e 0e 78 31 3d 66 2e 78 |idth the|n.x1=f.x|
|00000530| 2b 66 2e 77 69 64 74 68 | 11 79 31 3d 66 2e 79 2b |+f.width|.y1=f.y+|
|00000540| 66 2e 68 65 69 67 68 74 | 2f 32 08 78 32 3d 74 2e |f.height|/2.x2=t.|
|00000550| 78 2d 62 11 79 32 3d 74 | 2e 79 2b 74 2e 68 65 69 |x-b.y2=t|.y+t.hei|
|00000560| 67 68 74 2f 32 1d 65 6c | 73 65 69 66 20 66 2e 78 |ght/2.el|seif f.x|
|00000570| 20 3e 20 74 2e 78 2b 74 | 2e 77 69 64 74 68 20 74 | > t.x+t|.width t|
|00000580| 68 65 6e 06 78 31 3d 66 | 2e 78 11 79 31 3d 66 2e |hen.x1=f|.x.y1=f.|
|00000590| 79 2b 66 2e 68 65 69 67 | 68 74 2f 32 10 78 32 3d |y+f.heig|ht/2.x2=|
|000005a0| 74 2e 78 2b 74 2e 77 69 | 64 74 68 2b 62 11 79 32 |t.x+t.wi|dth+b.y2|
|000005b0| 3d 74 2e 79 2b 74 2e 68 | 65 69 67 68 74 2f 32 1e |=t.y+t.h|eight/2.|
|000005c0| 65 6c 73 65 69 66 20 74 | 2e 79 20 3e 20 66 2e 79 |elseif t|.y > f.y|
|000005d0| 2b 66 2e 68 65 69 67 68 | 74 20 74 68 65 6e 10 78 |+f.heigh|t then.x|
|000005e0| 31 3d 66 2e 78 2b 66 2e | 77 69 64 74 68 2f 32 0f |1=f.x+f.|width/2.|
|000005f0| 79 31 3d 66 2e 79 2b 66 | 2e 68 65 69 67 68 74 10 |y1=f.y+f|.height.|
|00000600| 78 32 3d 74 2e 78 2b 74 | 2e 77 69 64 74 68 2f 32 |x2=t.x+t|.width/2|
|00000610| 08 79 32 3d 74 2e 79 2d | 62 1e 65 6c 73 65 69 66 |.y2=t.y-|b.elseif|
|00000620| 20 66 2e 79 20 3e 20 74 | 2e 79 2b 74 2e 68 65 69 | f.y > t|.y+t.hei|
|00000630| 67 68 74 20 74 68 65 6e | 10 78 31 3d 66 2e 78 2b |ght then|.x1=f.x+|
|00000640| 66 2e 77 69 64 74 68 2f | 32 06 79 31 3d 66 2e 79 |f.width/|2.y1=f.y|
|00000650| 10 78 32 3d 74 2e 78 2b | 74 2e 77 69 64 74 68 2f |.x2=t.x+|t.width/|
|00000660| 32 11 79 32 3d 74 2e 79 | 2b 74 2e 68 65 69 67 68 |2.y2=t.y|+t.heigh|
|00000670| 74 2b 62 04 65 6c 73 65 | 2b 2f 2f 6e 6f 64 65 73 |t+b.else|+//nodes|
|00000680| 20 61 72 65 20 61 6c 72 | 65 61 64 79 20 63 6f 6e | are alr|eady con|
|00000690| 6e 65 63 74 65 64 2c 20 | 64 72 61 77 20 6e 6f 20 |nected, |draw no |
|000006a0| 6c 69 6e 6b 00 06 65 6e | 64 20 69 66 06 65 6e 64 |link..en|d if.end|
|000006b0| 20 69 66 00 18 69 66 20 | 78 31 3c 3e 78 32 20 6f | if..if |x1<>x2 o|
|000006c0| 72 20 79 31 3c 3e 79 32 | 20 74 68 65 6e 21 6f 66 |r y1<>y2| then!of|
|000006d0| 66 2e 67 72 61 70 68 69 | 63 73 2e 64 72 61 77 6c |f.graphi|cs.drawl|
|000006e0| 69 6e 65 20 78 31 2c 79 | 31 2c 78 32 2c 79 32 00 |ine x1,y|1,x2,y2.|
|000006f0| 23 69 66 20 6e 65 61 74 | 6c 69 6e 6b 73 20 74 68 |#if neat|links th|
|00000700| 65 6e 20 2f 2f 64 72 61 | 77 20 61 72 72 6f 77 20 |en //dra|w arrow |
|00000710| 68 65 61 64 11 6d 3d 28 | 79 32 2d 79 31 29 2f 28 |head.m=(|y2-y1)/(|
|00000720| 78 32 2d 78 31 29 09 61 | 3d 61 74 61 6e 28 6d 29 |x2-x1).a|=atan(m)|
|00000730| 2a 27 6f 66 66 2e 67 72 | 61 70 68 69 63 73 2e 64 |*'off.gr|aphics.d|
|00000740| 72 61 77 73 74 72 69 6e | 67 20 73 74 72 28 6d 29 |rawstrin|g str(m)|
|00000750| 2c 35 2c 35 2b 6e 75 6d | 2a 32 30 00 0e 69 66 20 |,5,5+num|*20..if |
|00000760| 78 32 3e 3d 78 31 20 74 | 68 65 6e 0e 69 66 20 79 |x2>=x1 t|hen.if y|
|00000770| 32 3e 3d 79 31 20 74 68 | 65 6e 04 73 3d 2d 31 04 |2>=y1 th|en.s=-1.|
|00000780| 65 6c 73 65 04 73 3d 2d | 31 06 65 6e 64 20 69 66 |else.s=-|1.end if|
|00000790| 04 65 6c 73 65 0e 69 66 | 20 79 32 3e 3d 79 31 20 |.else.if| y2>=y1 |
|000007a0| 74 68 65 6e 03 73 3d 31 | 04 65 6c 73 65 03 73 3d |then.s=1|.else.s=|
|000007b0| 31 06 65 6e 64 20 69 66 | 06 65 6e 64 20 69 66 00 |1.end if|.end if.|
|000007c0| 1b 61 78 31 3d 78 32 2b | 73 2a 63 6f 73 28 61 2b |.ax1=x2+|s*cos(a+|
|000007d0| 61 6e 67 6c 65 29 2a 61 | 72 72 6f 77 1b 61 79 31 |angle)*a|rrow.ay1|
|000007e0| 3d 79 32 2b 73 2a 73 69 | 6e 28 61 2b 61 6e 67 6c |=y2+s*si|n(a+angl|
|000007f0| 65 29 2a 61 72 72 6f 77 | 1b 61 78 32 3d 78 32 2b |e)*arrow|.ax2=x2+|
|00000800| 73 2a 63 6f 73 28 61 2d | 61 6e 67 6c 65 29 2a 61 |s*cos(a-|angle)*a|
|00000810| 72 72 6f 77 1b 61 79 32 | 3d 79 32 2b 73 2a 73 69 |rrow.ay2|=y2+s*si|
|00000820| 6e 28 61 2d 61 6e 67 6c | 65 29 2a 61 72 72 6f 77 |n(a-angl|e)*arrow|
|00000830| 00 23 6f 66 66 2e 67 72 | 61 70 68 69 63 73 2e 64 |.#off.gr|aphics.d|
|00000840| 72 61 77 6c 69 6e 65 20 | 78 32 2c 79 32 2c 61 78 |rawline |x2,y2,ax|
|00000850| 31 2c 61 79 31 23 6f 66 | 66 2e 67 72 61 70 68 69 |1,ay1#of|f.graphi|
|00000860| 63 73 2e 64 72 61 77 6c | 69 6e 65 20 78 32 2c 79 |cs.drawl|ine x2,y|
|00000870| 32 2c 61 78 32 2c 61 79 | 32 06 65 6e 64 20 69 66 |2,ax2,ay|2.end if|
|00000880| 06 65 6e 64 20 69 66 00 | 24 6f 66 66 2e 67 72 61 |.end if.|$off.gra|
|00000890| 70 68 69 63 73 2e 66 6f | 72 65 63 6f 6c 6f 72 3d |phics.fo|recolor=|
|000008a0| 6c 69 6e 6b 74 65 78 74 | 63 6f 6c 6f 72 95 01 6f |linktext|color..o|
|000008b0| 66 66 2e 67 72 61 70 68 | 69 63 73 2e 64 72 61 77 |ff.graph|ics.draw|
|000008c0| 73 74 72 69 6e 67 20 6c | 2e 6e 61 6d 65 2c 28 78 |string l|.name,(x|
|000008d0| 31 2b 78 32 29 2f 32 2d | 6f 66 66 2e 67 72 61 70 |1+x2)/2-|off.grap|
|000008e0| 68 69 63 73 2e 73 74 72 | 69 6e 67 77 69 64 74 68 |hics.str|ingwidth|
|000008f0| 28 6c 2e 6e 61 6d 65 29 | 2f 32 2c 28 79 31 2b 79 |(l.name)|/2,(y1+y|
|00000900| 32 29 2f 32 00 17 6f 66 | 66 2e 67 72 61 70 68 69 |2)/2..of|f.graphi|
|00000910| 63 73 2e 70 65 6e 77 69 | 64 74 68 3d 32 18 6f 66 |cs.penwi|dth=2.of|
|00000920| 66 2e 67 72 61 70 68 69 | 63 73 2e 70 65 6e 68 65 |f.graphi|cs.penhe|
|00000930| 69 67 68 74 3d 32 00 07 | 45 6e 64 20 53 75 62 08 |ight=2..|End Sub.|
|00000940| 64 72 61 77 6e 6f 64 65 | 0e 6e 75 6d 20 61 73 20 |drawnode|.num as |
|00000950| 69 6e 74 65 67 65 72 00 | 00 20 03 20 03 2a 1c 53 |integer.|. . .*.S|
|00000960| 75 62 20 64 72 61 77 6e | 6f 64 65 28 6e 75 6d 20 |ub drawn|ode(num |
|00000970| 61 73 20 69 6e 74 65 67 | 65 72 29 1a 64 69 6d 20 |as integ|er).dim |
|00000980| 74 68 65 78 2c 74 68 65 | 79 2c 77 20 61 73 20 69 |thex,the|y,w as i|
|00000990| 6e 74 65 67 65 72 0d 64 | 69 6d 20 6e 20 61 73 20 |nteger.d|im n as |
|000009a0| 6e 6f 64 65 0c 6e 3d 6e | 6f 64 65 73 28 6e 75 6d |node.n=n|odes(num|
|000009b0| 29 00 20 6f 66 66 2e 67 | 72 61 70 68 69 63 73 2e |). off.g|raphics.|
|000009c0| 66 6f 72 65 63 6f 6c 6f | 72 3d 6e 2e 6d 79 63 6f |forecolo|r=n.myco|
|000009d0| 6c 6f 72 13 53 65 6c 65 | 63 74 20 43 61 73 65 20 |lor.Sele|ct Case |
|000009e0| 6e 2e 73 68 61 70 65 14 | 43 61 73 65 20 30 20 2f |n.shape.|Case 0 /|
|000009f0| 2f 63 69 72 63 6c 65 2f | 6f 76 61 6c 2e 6f 66 66 |/circle/|oval.off|
|00000a00| 2e 67 72 61 70 68 69 63 | 73 2e 66 69 6c 6c 6f 76 |.graphic|s.fillov|
|00000a10| 61 6c 20 6e 2e 78 2c 6e | 2e 79 2c 6e 2e 77 69 64 |al n.x,n|.y,n.wid|
|00000a20| 74 68 2c 6e 2e 68 65 69 | 67 68 74 12 43 61 73 65 |th,n.hei|ght.Case|
|00000a30| 20 31 20 2f 2f 72 65 63 | 74 61 6e 67 6c 65 2e 6f | 1 //rec|tangle.o|
|00000a40| 66 66 2e 67 72 61 70 68 | 69 63 73 2e 66 69 6c 6c |ff.graph|ics.fill|
|00000a50| 72 65 63 74 20 6e 2e 78 | 2c 6e 2e 79 2c 6e 2e 77 |rect n.x|,n.y,n.w|
|00000a60| 69 64 74 68 2c 6e 2e 68 | 65 69 67 68 74 0a 45 6e |idth,n.h|eight.En|
|00000a70| 64 20 53 65 6c 65 63 74 | 00 13 69 66 20 73 65 6c |d Select|..if sel|
|00000a80| 6e 6f 64 65 3d 6e 75 6d | 20 74 68 65 6e 23 6f 66 |node=num| then#of|
|00000a90| 66 2e 67 72 61 70 68 69 | 63 73 2e 66 6f 72 65 63 |f.graphi|cs.forec|
|00000aa0| 6f 6c 6f 72 3d 72 67 62 | 28 32 35 30 2c 30 2c 30 |olor=rgb|(250,0,0|
|00000ab0| 29 04 65 6c 73 65 20 6f | 66 66 2e 67 72 61 70 68 |).else o|ff.graph|
|00000ac0| 69 63 73 2e 66 6f 72 65 | 63 6f 6c 6f 72 3d 6e 6f |ics.fore|color=no|
|00000ad0| 64 65 63 6f 6c 6f 72 06 | 65 6e 64 20 69 66 13 53 |decolor.|end if.S|
|00000ae0| 65 6c 65 63 74 20 43 61 | 73 65 20 6e 2e 73 68 61 |elect Ca|se n.sha|
|00000af0| 70 65 14 43 61 73 65 20 | 30 20 2f 2f 63 69 72 63 |pe.Case |0 //circ|
|00000b00| 6c 65 2f 6f 76 61 6c 2e | 6f 66 66 2e 67 72 61 70 |le/oval.|off.grap|
|00000b10| 68 69 63 73 2e 64 72 61 | 77 6f 76 61 6c 20 6e 2e |hics.dra|woval n.|
|00000b20| 78 2c 6e 2e 79 2c 6e 2e | 77 69 64 74 68 2c 6e 2e |x,n.y,n.|width,n.|
|00000b30| 68 65 69 67 68 74 12 43 | 61 73 65 20 31 20 2f 2f |height.C|ase 1 //|
|00000b40| 72 65 63 74 61 6e 67 6c | 65 2e 6f 66 66 2e 67 72 |rectangl|e.off.gr|
|00000b50| 61 70 68 69 63 73 2e 64 | 72 61 77 72 65 63 74 20 |aphics.d|rawrect |
|00000b60| 6e 2e 78 2c 6e 2e 79 2c | 6e 2e 77 69 64 74 68 2c |n.x,n.y,|n.width,|
|00000b70| 6e 2e 68 65 69 67 68 74 | 0a 45 6e 64 20 53 65 6c |n.height|.End Sel|
|00000b80| 65 63 74 00 20 6f 66 66 | 2e 67 72 61 70 68 69 63 |ect. off|.graphic|
|00000b90| 73 2e 66 6f 72 65 63 6f | 6c 6f 72 3d 6e 6f 64 65 |s.foreco|lor=node|
|00000ba0| 63 6f 6c 6f 72 1c 6f 66 | 66 2e 67 72 61 70 68 69 |color.of|f.graphi|
|00000bb0| 63 73 2e 74 65 78 74 66 | 6f 6e 74 3d 6d 79 66 6f |cs.textf|ont=myfo|
|00000bc0| 6e 74 35 74 68 65 78 3d | 6e 2e 78 2b 6e 2e 77 69 |nt5thex=|n.x+n.wi|
|00000bd0| 64 74 68 2f 32 2d 6f 66 | 66 2e 67 72 61 70 68 69 |dth/2-of|f.graphi|
|00000be0| 63 73 2e 73 74 72 69 6e | 67 77 69 64 74 68 28 6e |cs.strin|gwidth(n|
|00000bf0| 2e 6e 61 6d 65 29 2f 32 | 2d 74 68 65 79 3d 6e 2e |.name)/2|-they=n.|
|00000c00| 79 2b 6e 2e 68 65 69 67 | 68 74 2f 32 2b 6f 66 66 |y+n.heig|ht/2+off|
|00000c10| 2e 67 72 61 70 68 69 63 | 73 2e 74 65 78 74 68 65 |.graphic|s.texthe|
|00000c20| 69 67 68 74 2f 32 28 6f | 66 66 2e 67 72 61 70 68 |ight/2(o|ff.graph|
|00000c30| 69 63 73 2e 64 72 61 77 | 73 74 72 69 6e 67 20 6e |ics.draw|string n|
|00000c40| 2e 6e 61 6d 65 2c 74 68 | 65 78 2c 74 68 65 79 00 |.name,th|ex,they.|
|00000c50| 20 69 66 20 65 64 69 74 | 6d 6f 64 65 20 61 6e 64 | if edit|mode and|
|00000c60| 20 73 65 6c 6e 6f 64 65 | 3d 6e 75 6d 20 74 68 65 | selnode|=num the|
|00000c70| 6e 03 77 3d 36 21 6f 66 | 66 2e 67 72 61 70 68 69 |n.w=6!of|f.graphi|
|00000c80| 63 73 2e 66 6f 72 65 63 | 6f 6c 6f 72 3d 72 67 62 |cs.forec|olor=rgb|
|00000c90| 28 30 2c 30 2c 30 29 29 | 6f 66 66 2e 67 72 61 70 |(0,0,0))|off.grap|
|00000ca0| 68 69 63 73 2e 66 69 6c | 6c 72 65 63 74 20 6e 2e |hics.fil|lrect n.|
|00000cb0| 78 2d 77 2f 32 2c 6e 2e | 79 2d 77 2f 32 2c 77 2c |x-w/2,n.|y-w/2,w,|
|00000cc0| 77 32 6f 66 66 2e 67 72 | 61 70 68 69 63 73 2e 66 |w2off.gr|aphics.f|
|00000cd0| 69 6c 6c 72 65 63 74 20 | 6e 2e 78 2d 77 2f 32 2c |illrect |n.x-w/2,|
|00000ce0| 6e 2e 79 2b 6e 2e 68 65 | 69 67 68 74 2d 77 2f 32 |n.y+n.he|ight-w/2|
|00000cf0| 2c 77 2c 77 31 6f 66 66 | 2e 67 72 61 70 68 69 63 |,w,w1off|.graphic|
|00000d00| 73 2e 66 69 6c 6c 72 65 | 63 74 20 6e 2e 78 2b 6e |s.fillre|ct n.x+n|
|00000d10| 2e 77 69 64 74 68 2d 77 | 2f 32 2c 6e 2e 79 2d 77 |.width-w|/2,n.y-w|
|00000d20| 2f 32 2c 77 2c 77 3a 6f | 66 66 2e 67 72 61 70 68 |/2,w,w:o|ff.graph|
|00000d30| 69 63 73 2e 66 69 6c 6c | 72 65 63 74 20 6e 2e 78 |ics.fill|rect n.x|
|00000d40| 2b 6e 2e 77 69 64 74 68 | 2d 77 2f 32 2c 6e 2e 79 |+n.width|-w/2,n.y|
|00000d50| 2b 6e 2e 68 65 69 67 68 | 74 2d 77 2f 32 2c 77 2c |+n.heigh|t-w/2,w,|
|00000d60| 77 06 65 6e 64 20 69 66 | 00 00 07 45 6e 64 20 53 |w.end if|...End S|
|00000d70| 75 62 0a 77 69 74 68 69 | 6e 4e 6f 64 65 0e 6e 75 |ub.withi|nNode.nu|
|00000d80| 6d 20 61 73 20 69 6e 74 | 65 67 65 72 07 42 6f 6f |m as int|eger.Boo|
|00000d90| 6c 65 61 6e 00 0a 0b 0a | 0b 0d 2e 46 75 6e 63 74 |lean....|...Funct|
|00000da0| 69 6f 6e 20 77 69 74 68 | 69 6e 4e 6f 64 65 28 6e |ion with|inNode(n|
|00000db0| 75 6d 20 61 73 20 69 6e | 74 65 67 65 72 29 20 41 |um as in|teger) A|
|00000dc0| 73 20 42 6f 6f 6c 65 61 | 6e 0d 64 69 6d 20 6e 20 |s Boolea|n.dim n |
|00000dd0| 61 73 20 6e 6f 64 65 0c | 6e 3d 6e 6f 64 65 73 28 |as node.|n=nodes(|
|00000de0| 6e 75 6d 29 00 2d 69 66 | 20 6c 61 73 74 78 20 3e |num).-if| lastx >|
|00000df0| 3d 20 6e 2e 78 20 61 6e | 64 20 6c 61 73 74 78 20 |= n.x an|d lastx |
|00000e00| 3c 3d 20 6e 2e 78 2b 6e | 2e 77 69 64 74 68 20 74 |<= n.x+n|.width t|
|00000e10| 68 65 6e 2e 69 66 20 6c | 61 73 74 79 20 3e 3d 20 |hen.if l|asty >= |
|00000e20| 6e 2e 79 20 61 6e 64 20 | 6c 61 73 74 79 20 3c 3d |n.y and |lasty <=|
|00000e30| 20 6e 2e 79 2b 6e 2e 68 | 65 69 67 68 74 20 74 68 | n.y+n.h|eight th|
|00000e40| 65 6e 0b 72 65 74 75 72 | 6e 20 74 72 75 65 06 65 |en.retur|n true.e|
|00000e50| 6e 64 20 69 66 06 65 6e | 64 20 69 66 00 0c 72 65 |nd if.en|d if..re|
|00000e60| 74 75 72 6e 20 66 61 6c | 73 65 00 0c 45 6e 64 20 |turn fal|se..End |
|00000e70| 46 75 6e 63 74 69 6f 6e | 0a 77 69 74 68 69 6e 4c |Function|.withinL|
|00000e80| 69 6e 6b 0e 6e 75 6d 20 | 61 73 20 69 6e 74 65 67 |ink.num |as integ|
|00000e90| 65 72 07 42 6f 6f 6c 65 | 61 6e 00 17 10 17 10 36 |er.Boole|an.....6|
|00000ea0| 2e 46 75 6e 63 74 69 6f | 6e 20 77 69 74 68 69 6e |.Functio|n within|
|00000eb0| 4c 69 6e 6b 28 6e 75 6d | 20 61 73 20 69 6e 74 65 |Link(num| as inte|
|00000ec0| 67 65 72 29 20 41 73 20 | 42 6f 6f 6c 65 61 6e 21 |ger) As |Boolean!|
|00000ed0| 64 69 6d 20 78 31 2c 78 | 32 2c 79 31 2c 79 32 2c |dim x1,x|2,y1,y2,|
|00000ee0| 74 68 65 79 2c 62 20 61 | 73 20 69 6e 74 65 67 65 |they,b a|s intege|
|00000ef0| 72 0f 64 69 6d 20 6d 20 | 61 73 20 64 6f 75 62 6c |r.dim m |as doubl|
|00000f00| 65 0d 64 69 6d 20 6c 20 | 61 73 20 6c 69 6e 6b 0f |e.dim l |as link.|
|00000f10| 64 69 6d 20 66 2c 74 20 | 61 73 20 6e 6f 64 65 0c |dim f,t |as node.|
|00000f20| 6c 3d 6c 69 6e 6b 73 28 | 6e 75 6d 29 0c 66 3d 6c |l=links(|num).f=l|
|00000f30| 2e 66 72 6f 6d 6e 6f 64 | 65 0a 74 3d 6c 2e 74 6f |.fromnod|e.t=l.to|
|00000f40| 6e 6f 64 65 00 03 62 3d | 35 00 16 69 66 20 6e 6f |node..b=|5..if no|
|00000f50| 74 28 6e 65 61 74 6c 69 | 6e 6b 73 29 20 74 68 65 |t(neatli|nks) the|
|00000f60| 6e 10 78 31 3d 66 2e 78 | 2b 66 2e 77 69 64 74 68 |n.x1=f.x|+f.width|
|00000f70| 2f 32 11 79 31 3d 66 2e | 79 2b 66 2e 68 65 69 67 |/2.y1=f.|y+f.heig|
|00000f80| 68 74 2f 32 10 78 32 3d | 74 2e 78 2b 74 2e 77 69 |ht/2.x2=|t.x+t.wi|
|00000f90| 64 74 68 2f 32 11 79 32 | 3d 74 2e 79 2b 74 2e 68 |dth/2.y2|=t.y+t.h|
|00000fa0| 65 69 67 68 74 2f 32 04 | 65 6c 73 65 19 69 66 20 |eight/2.|else.if |
|00000fb0| 74 2e 78 20 3e 20 66 2e | 78 2b 66 2e 77 69 64 74 |t.x > f.|x+f.widt|
|00000fc0| 68 20 74 68 65 6e 0e 78 | 31 3d 66 2e 78 2b 66 2e |h then.x|1=f.x+f.|
|00000fd0| 77 69 64 74 68 11 79 31 | 3d 66 2e 79 2b 66 2e 68 |width.y1|=f.y+f.h|
|00000fe0| 65 69 67 68 74 2f 32 08 | 78 32 3d 74 2e 78 2d 62 |eight/2.|x2=t.x-b|
|00000ff0| 11 79 32 3d 74 2e 79 2b | 74 2e 68 65 69 67 68 74 |.y2=t.y+|t.height|
|00001000| 2f 32 1d 65 6c 73 65 69 | 66 20 66 2e 78 20 3e 20 |/2.elsei|f f.x > |
|00001010| 74 2e 78 2b 74 2e 77 69 | 64 74 68 20 74 68 65 6e |t.x+t.wi|dth then|
|00001020| 06 78 31 3d 66 2e 78 11 | 79 31 3d 66 2e 79 2b 66 |.x1=f.x.|y1=f.y+f|
|00001030| 2e 68 65 69 67 68 74 2f | 32 10 78 32 3d 74 2e 78 |.height/|2.x2=t.x|
|00001040| 2b 74 2e 77 69 64 74 68 | 2b 62 11 79 32 3d 74 2e |+t.width|+b.y2=t.|
|00001050| 79 2b 74 2e 68 65 69 67 | 68 74 2f 32 1e 65 6c 73 |y+t.heig|ht/2.els|
|00001060| 65 69 66 20 74 2e 79 20 | 3e 20 66 2e 79 2b 66 2e |eif t.y |> f.y+f.|
|00001070| 68 65 69 67 68 74 20 74 | 68 65 6e 10 78 31 3d 66 |height t|hen.x1=f|
|00001080| 2e 78 2b 66 2e 77 69 64 | 74 68 2f 32 0f 79 31 3d |.x+f.wid|th/2.y1=|
|00001090| 66 2e 79 2b 66 2e 68 65 | 69 67 68 74 10 78 32 3d |f.y+f.he|ight.x2=|
|000010a0| 74 2e 78 2b 74 2e 77 69 | 64 74 68 2f 32 08 79 32 |t.x+t.wi|dth/2.y2|
|000010b0| 3d 74 2e 79 2d 62 1e 65 | 6c 73 65 69 66 20 66 2e |=t.y-b.e|lseif f.|
|000010c0| 79 20 3e 20 74 2e 79 2b | 74 2e 68 65 69 67 68 74 |y > t.y+|t.height|
|000010d0| 20 74 68 65 6e 10 78 31 | 3d 66 2e 78 2b 66 2e 77 | then.x1|=f.x+f.w|
|000010e0| 69 64 74 68 2f 32 06 79 | 31 3d 66 2e 79 10 78 32 |idth/2.y|1=f.y.x2|
|000010f0| 3d 74 2e 78 2b 74 2e 77 | 69 64 74 68 2f 32 11 79 |=t.x+t.w|idth/2.y|
|00001100| 32 3d 74 2e 79 2b 74 2e | 68 65 69 67 68 74 2b 62 |2=t.y+t.|height+b|
|00001110| 04 65 6c 73 65 2b 2f 2f | 6e 6f 64 65 73 20 61 72 |.else+//|nodes ar|
|00001120| 65 20 61 6c 72 65 61 64 | 79 20 63 6f 6e 6e 65 63 |e alread|y connec|
|00001130| 74 65 64 2c 20 64 72 61 | 77 20 6e 6f 20 6c 69 6e |ted, dra|w no lin|
|00001140| 6b 00 06 65 6e 64 20 69 | 66 06 65 6e 64 20 69 66 |k..end i|f.end if|
|00001150| 2a 6d 3d 28 79 32 2d 79 | 31 29 2f 28 78 32 2d 78 |*m=(y2-y|1)/(x2-x|
|00001160| 31 29 20 2f 2f 73 6c 6f | 70 65 20 6f 66 20 74 68 |1) //slo|pe of th|
|00001170| 65 20 6c 69 6e 6b 20 6c | 69 6e 65 1c 74 68 65 79 |e link l|ine.they|
|00001180| 3d 6d 20 2a 20 6c 61 73 | 74 78 20 2d 20 28 6d 2a |=m * las|tx - (m*|
|00001190| 78 31 20 2d 20 79 31 29 | 00 33 69 66 20 6c 61 73 |x1 - y1)|.3if las|
|000011a0| 74 78 20 3e 3d 20 6d 69 | 6e 28 78 31 2c 78 32 29 |tx >= mi|n(x1,x2)|
|000011b0| 20 61 6e 64 20 6c 61 73 | 74 78 20 3c 3d 20 6d 61 | and las|tx <= ma|
|000011c0| 78 28 78 31 2c 78 32 29 | 20 74 68 65 6e 28 69 66 |x(x1,x2)| then(if|
|000011d0| 20 61 62 73 28 6c 61 73 | 74 79 2d 74 68 65 79 29 | abs(las|ty-they)|
|000011e0| 20 3c 3d 20 6c 2e 74 68 | 69 63 6b 6e 65 73 73 2b | <= l.th|ickness+|
|000011f0| 35 20 74 68 65 6e 0b 72 | 65 74 75 72 6e 20 74 72 |5 then.r|eturn tr|
|00001200| 75 65 06 65 6e 64 20 69 | 66 06 65 6e 64 20 69 66 |ue.end i|f.end if|
|00001210| 00 0c 72 65 74 75 72 6e | 20 66 61 6c 73 65 00 0c |..return| false..|
|00001220| 45 6e 64 20 46 75 6e 63 | 74 69 6f 6e 08 64 72 61 |End Func|tion.dra|
|00001230| 67 4e 6f 64 65 0e 6e 75 | 6d 20 61 73 20 69 6e 74 |gNode.nu|m as int|
|00001240| 65 67 65 72 07 42 6f 6f | 6c 65 61 6e 00 15 04 15 |eger.Boo|lean....|
|00001250| 04 20 2c 46 75 6e 63 74 | 69 6f 6e 20 64 72 61 67 |. ,Funct|ion drag|
|00001260| 4e 6f 64 65 28 6e 75 6d | 20 61 73 20 69 6e 74 65 |Node(num| as inte|
|00001270| 67 65 72 29 20 41 73 20 | 42 6f 6f 6c 65 61 6e 10 |ger) As |Boolean.|
|00001280| 64 69 6d 20 77 20 61 73 | 20 69 6e 74 65 67 65 72 |dim w as| integer|
|00001290| 0d 64 69 6d 20 6e 20 61 | 73 20 6e 6f 64 65 0c 6e |.dim n a|s node.n|
|000012a0| 3d 6e 6f 64 65 73 28 6e | 75 6d 29 03 77 3d 36 00 |=nodes(n|um).w=6.|
|000012b0| 35 69 66 20 6c 61 73 74 | 78 20 3e 3d 20 6e 2e 78 |5if last|x >= n.x|
|000012c0| 2d 77 2f 32 20 61 6e 64 | 20 6c 61 73 74 78 20 3c |-w/2 and| lastx <|
|000012d0| 3d 20 6e 2e 78 2b 6e 2e | 77 69 64 74 68 2b 77 2f |= n.x+n.|width+w/|
|000012e0| 32 20 74 68 65 6e 36 69 | 66 20 6c 61 73 74 79 20 |2 then6i|f lasty |
|000012f0| 3e 3d 20 6e 2e 79 2d 77 | 2f 32 20 61 6e 64 20 6c |>= n.y-w|/2 and l|
|00001300| 61 73 74 79 20 3c 3d 20 | 6e 2e 79 2b 6e 2e 68 65 |asty <= |n.y+n.he|
|00001310| 69 67 68 74 2b 77 2f 32 | 20 74 68 65 6e 18 69 66 |ight+w/2| then.if|
|00001320| 20 6c 61 73 74 78 20 3c | 3d 20 6e 2e 78 2b 77 2f | lastx <|= n.x+w/|
|00001330| 32 20 74 68 65 6e 18 69 | 66 20 6c 61 73 74 79 20 |2 then.i|f lasty |
|00001340| 3c 3d 20 6e 2e 79 2b 77 | 2f 32 20 74 68 65 6e 14 |<= n.y+w|/2 then.|
|00001350| 64 72 61 67 64 69 72 3d | 31 20 2f 2f 74 6f 70 20 |dragdir=|1 //top |
|00001360| 6c 65 66 74 0b 72 65 74 | 75 72 6e 20 74 72 75 65 |left.ret|urn true|
|00001370| 25 65 6c 73 65 69 66 20 | 6c 61 73 74 79 20 3e 3d |%elseif |lasty >=|
|00001380| 20 6e 2e 79 2b 6e 2e 68 | 65 69 67 68 74 2d 77 2f | n.y+n.h|eight-w/|
|00001390| 32 20 74 68 65 6e 17 64 | 72 61 67 64 69 72 3d 32 |2 then.d|ragdir=2|
|000013a0| 20 2f 2f 62 6f 74 74 6f | 6d 20 6c 65 66 74 0b 72 | //botto|m left.r|
|000013b0| 65 74 75 72 6e 20 74 72 | 75 65 06 65 6e 64 20 69 |eturn tr|ue.end i|
|000013c0| 66 24 65 6c 73 65 69 66 | 20 6c 61 73 74 78 20 3e |f$elseif| lastx >|
|000013d0| 3d 20 6e 2e 78 2b 6e 2e | 77 69 64 74 68 2d 77 2f |= n.x+n.|width-w/|
|000013e0| 32 20 74 68 65 6e 18 69 | 66 20 6c 61 73 74 79 20 |2 then.i|f lasty |
|000013f0| 3c 3d 20 6e 2e 79 2b 77 | 2f 32 20 74 68 65 6e 15 |<= n.y+w|/2 then.|
|00001400| 64 72 61 67 64 69 72 3d | 33 20 2f 2f 74 6f 70 20 |dragdir=|3 //top |
|00001410| 72 69 67 68 74 0b 72 65 | 74 75 72 6e 20 74 72 75 |right.re|turn tru|
|00001420| 65 25 65 6c 73 65 69 66 | 20 6c 61 73 74 79 20 3e |e%elseif| lasty >|
|00001430| 3d 20 6e 2e 79 2b 6e 2e | 68 65 69 67 68 74 2d 77 |= n.y+n.|height-w|
|00001440| 2f 32 20 74 68 65 6e 18 | 64 72 61 67 64 69 72 3d |/2 then.|dragdir=|
|00001450| 34 20 2f 2f 62 6f 74 74 | 6f 6d 20 72 69 67 68 74 |4 //bott|om right|
|00001460| 0b 72 65 74 75 72 6e 20 | 74 72 75 65 06 65 6e 64 |.return |true.end|
|00001470| 20 69 66 06 65 6e 64 20 | 69 66 06 65 6e 64 20 69 | if.end |if.end i|
|00001480| 66 06 65 6e 64 20 69 66 | 00 0c 72 65 74 75 72 6e |f.end if|..return|
|00001490| 20 66 61 6c 73 65 00 00 | 0c 45 6e 64 20 46 75 6e | false..|.End Fun|
|000014a0| 63 74 69 6f 6e 05 04 4f | 70 65 6e 00 00 0c 6c 69 |ction..O|pen...li|
|000014b0| 6e 6b 73 65 6c 65 63 74 | 65 64 0e 6e 75 6d 20 61 |nkselect|ed.num a|
|000014c0| 73 20 69 6e 74 65 67 65 | 72 00 0c 6e 6f 64 65 73 |s intege|r..nodes|
|000014d0| 65 6c 65 63 74 65 64 0e | 6e 75 6d 20 61 73 20 69 |elected.|num as i|
|000014e0| 6e 74 65 67 65 72 00 11 | 44 6f 75 62 6c 65 43 6c |nteger..|DoubleCl|
|000014f0| 69 63 6b 65 64 4e 6f 64 | 65 0e 6e 75 6d 20 61 73 |ickedNod|e.num as|
|00001500| 20 69 6e 74 65 67 65 72 | 00 11 44 6f 75 62 6c 65 | integer|..Double|
|00001510| 43 6c 69 63 6b 65 64 4c | 69 6e 6b 0e 6e 75 6d 20 |ClickedL|ink.num |
|00001520| 61 73 20 69 6e 74 65 67 | 65 72 00 05 07 4d 6f 75 |as integ|er...Mou|
|00001530| 73 65 55 70 05 00 05 00 | 07 27 53 75 62 20 4d 6f |seUp....|.'Sub Mo|
|00001540| 75 73 65 55 70 28 58 20 | 41 73 20 49 6e 74 65 67 |useUp(X |As Integ|
|00001550| 65 72 2c 20 59 20 41 73 | 20 49 6e 74 65 67 65 72 |er, Y As| Integer|
|00001560| 29 00 14 69 66 20 64 72 | 61 67 64 69 72 20 3c 3e |)..if dr|agdir <>|
|00001570| 20 30 20 74 68 65 6e 0b | 64 72 61 67 64 69 72 20 | 0 then.|dragdir |
|00001580| 3d 20 30 06 65 6e 64 20 | 69 66 00 07 45 6e 64 20 |= 0.end |if..End |
|00001590| 53 75 62 09 4d 6f 75 73 | 65 44 72 61 67 12 31 12 |Sub.Mous|eDrag.1.|
|000015a0| 31 21 29 53 75 62 20 4d | 6f 75 73 65 44 72 61 67 |1!)Sub M|ouseDrag|
|000015b0| 28 58 20 41 73 20 49 6e | 74 65 67 65 72 2c 20 59 |(X As In|teger, Y|
|000015c0| 20 41 73 20 49 6e 74 65 | 67 65 72 29 15 64 69 6d | As Inte|ger).dim|
|000015d0| 20 73 78 2c 20 73 79 20 | 61 73 20 69 6e 74 65 67 | sx, sy |as integ|
|000015e0| 65 72 0a 73 78 3d 78 2d | 6c 61 73 74 78 0a 73 79 |er.sx=x-|lastx.sy|
|000015f0| 3d 79 2d 6c 61 73 74 79 | 00 13 69 66 20 73 65 6c |=y-lasty|..if sel|
|00001600| 6e 6f 64 65 20 3e 20 30 | 20 74 68 65 6e 13 53 65 |node > 0| then.Se|
|00001610| 6c 65 63 74 20 43 61 73 | 65 20 64 72 61 67 64 69 |lect Cas|e dragdi|
|00001620| 72 06 43 61 73 65 20 30 | 26 6e 6f 64 65 73 28 73 |r.Case 0|&nodes(s|
|00001630| 65 6c 6e 6f 64 65 29 2e | 78 3d 6e 6f 64 65 73 28 |elnode).|x=nodes(|
|00001640| 73 65 6c 6e 6f 64 65 29 | 2e 78 20 2b 20 73 78 26 |selnode)|.x + sx&|
|00001650| 6e 6f 64 65 73 28 73 65 | 6c 6e 6f 64 65 29 2e 79 |nodes(se|lnode).y|
|00001660| 3d 6e 6f 64 65 73 28 73 | 65 6c 6e 6f 64 65 29 2e |=nodes(s|elnode).|
|00001670| 79 20 2b 20 73 79 11 43 | 61 73 65 20 31 20 2f 2f |y + sy.C|ase 1 //|
|00001680| 74 6f 70 20 6c 65 66 74 | 26 6e 6f 64 65 73 28 73 |top left|&nodes(s|
|00001690| 65 6c 6e 6f 64 65 29 2e | 78 3d 6e 6f 64 65 73 28 |elnode).|x=nodes(|
|000016a0| 73 65 6c 6e 6f 64 65 29 | 2e 78 20 2b 20 73 78 a4 |selnode)|.x + sx.|
|000016b0| 01 6e 6f 64 65 73 28 73 | 65 6c 6e 6f 64 65 29 2e |.nodes(s|elnode).|
|000016c0| 77 69 64 74 68 3d 6d 61 | 78 28 6e 6f 64 65 73 28 |width=ma|x(nodes(|
|000016d0| 73 65 6c 6e 6f 64 65 29 | 2e 77 69 64 74 68 20 2d |selnode)|.width -|
|000016e0| 20 73 78 2c 20 6f 66 66 | 2e 67 72 61 70 68 69 63 | sx, off|.graphic|
|000016f0| 73 2e 73 74 72 69 6e 67 | 77 69 64 74 68 28 6e 6f |s.string|width(no|
|00001700| 64 65 73 28 73 65 6c 6e | 6f 64 65 29 2e 6e 61 6d |des(seln|ode).nam|
|00001710| 65 29 2b 35 29 26 6e 6f | 64 65 73 28 73 65 6c 6e |e)+5)&no|des(seln|
|00001720| 6f 64 65 29 2e 79 3d 6e | 6f 64 65 73 28 73 65 6c |ode).y=n|odes(sel|
|00001730| 6e 6f 64 65 29 2e 79 20 | 2b 20 73 79 8f 01 6e 6f |node).y |+ sy..no|
|00001740| 64 65 73 28 73 65 6c 6e | 6f 64 65 29 2e 68 65 69 |des(seln|ode).hei|
|00001750| 67 68 74 3d 6d 61 78 28 | 6e 6f 64 65 73 28 73 65 |ght=max(|nodes(se|
|00001760| 6c 6e 6f 64 65 29 2e 68 | 65 69 67 68 74 20 2d 20 |lnode).h|eight - |
|00001770| 73 79 2c 6f 66 66 2e 67 | 72 61 70 68 69 63 73 2e |sy,off.g|raphics.|
|00001780| 74 65 78 74 68 65 69 67 | 68 74 2b 35 29 14 43 61 |textheig|ht+5).Ca|
|00001790| 73 65 20 32 20 2f 2f 62 | 6f 74 74 6f 6d 20 6c 65 |se 2 //b|ottom le|
|000017a0| 66 74 26 6e 6f 64 65 73 | 28 73 65 6c 6e 6f 64 65 |ft&nodes|(selnode|
|000017b0| 29 2e 78 3d 6e 6f 64 65 | 73 28 73 65 6c 6e 6f 64 |).x=node|s(selnod|
|000017c0| 65 29 2e 78 20 2b 20 73 | 78 a4 01 6e 6f 64 65 73 |e).x + s|x..nodes|
|000017d0| 28 73 65 6c 6e 6f 64 65 | 29 2e 77 69 64 74 68 3d |(selnode|).width=|
|000017e0| 6d 61 78 28 6e 6f 64 65 | 73 28 73 65 6c 6e 6f 64 |max(node|s(selnod|
|000017f0| 65 29 2e 77 69 64 74 68 | 20 2d 20 73 78 2c 20 6f |e).width| - sx, o|
|00001800| 66 66 2e 67 72 61 70 68 | 69 63 73 2e 73 74 72 69 |ff.graph|ics.stri|
|00001810| 6e 67 77 69 64 74 68 28 | 6e 6f 64 65 73 28 73 65 |ngwidth(|nodes(se|
|00001820| 6c 6e 6f 64 65 29 2e 6e | 61 6d 65 29 2b 35 29 8f |lnode).n|ame)+5).|
|00001830| 01 6e 6f 64 65 73 28 73 | 65 6c 6e 6f 64 65 29 2e |.nodes(s|elnode).|
|00001840| 68 65 69 67 68 74 3d 6d | 61 78 28 6e 6f 64 65 73 |height=m|ax(nodes|
|00001850| 28 73 65 6c 6e 6f 64 65 | 29 2e 68 65 69 67 68 74 |(selnode|).height|
|00001860| 20 2b 20 73 79 2c 6f 66 | 66 2e 67 72 61 70 68 69 | + sy,of|f.graphi|
|00001870| 63 73 2e 74 65 78 74 68 | 65 69 67 68 74 2b 35 29 |cs.texth|eight+5)|
|00001880| 12 43 61 73 65 20 33 20 | 2f 2f 74 6f 70 20 72 69 |.Case 3 |//top ri|
|00001890| 67 68 74 26 6e 6f 64 65 | 73 28 73 65 6c 6e 6f 64 |ght&node|s(selnod|
|000018a0| 65 29 2e 79 3d 6e 6f 64 | 65 73 28 73 65 6c 6e 6f |e).y=nod|es(selno|
|000018b0| 64 65 29 2e 79 20 2b 20 | 73 79 8f 01 6e 6f 64 65 |de).y + |sy..node|
|000018c0| 73 28 73 65 6c 6e 6f 64 | 65 29 2e 68 65 69 67 68 |s(selnod|e).heigh|
|000018d0| 74 3d 6d 61 78 28 6e 6f | 64 65 73 28 73 65 6c 6e |t=max(no|des(seln|
|000018e0| 6f 64 65 29 2e 68 65 69 | 67 68 74 20 2d 20 73 79 |ode).hei|ght - sy|
|000018f0| 2c 6f 66 66 2e 67 72 61 | 70 68 69 63 73 2e 74 65 |,off.gra|phics.te|
|00001900| 78 74 68 65 69 67 68 74 | 2b 35 29 a4 01 6e 6f 64 |xtheight|+5)..nod|
|00001910| 65 73 28 73 65 6c 6e 6f | 64 65 29 2e 77 69 64 74 |es(selno|de).widt|
|00001920| 68 3d 6d 61 78 28 6e 6f | 64 65 73 28 73 65 6c 6e |h=max(no|des(seln|
|00001930| 6f 64 65 29 2e 77 69 64 | 74 68 20 2b 20 73 78 2c |ode).wid|th + sx,|
|00001940| 20 6f 66 66 2e 67 72 61 | 70 68 69 63 73 2e 73 74 | off.gra|phics.st|
|00001950| 72 69 6e 67 77 69 64 74 | 68 28 6e 6f 64 65 73 28 |ringwidt|h(nodes(|
|00001960| 73 65 6c 6e 6f 64 65 29 | 2e 6e 61 6d 65 29 2b 35 |selnode)|.name)+5|
|00001970| 29 15 43 61 73 65 20 34 | 20 2f 2f 62 6f 74 74 6f |).Case 4| //botto|
|00001980| 6d 20 72 69 67 68 74 a4 | 01 6e 6f 64 65 73 28 73 |m right.|.nodes(s|
|00001990| 65 6c 6e 6f 64 65 29 2e | 77 69 64 74 68 3d 6d 61 |elnode).|width=ma|
|000019a0| 78 28 6e 6f 64 65 73 28 | 73 65 6c 6e 6f 64 65 29 |x(nodes(|selnode)|
|000019b0| 2e 77 69 64 74 68 20 2b | 20 73 78 2c 20 6f 66 66 |.width +| sx, off|
|000019c0| 2e 67 72 61 70 68 69 63 | 73 2e 73 74 72 69 6e 67 |.graphic|s.string|
|000019d0| 77 69 64 74 68 28 6e 6f | 64 65 73 28 73 65 6c 6e |width(no|des(seln|
|000019e0| 6f 64 65 29 2e 6e 61 6d | 65 29 2b 35 29 8f 01 6e |ode).nam|e)+5)..n|
|000019f0| 6f 64 65 73 28 73 65 6c | 6e 6f 64 65 29 2e 68 65 |odes(sel|node).he|
|00001a00| 69 67 68 74 3d 6d 61 78 | 28 6e 6f 64 65 73 28 73 |ight=max|(nodes(s|
|00001a10| 65 6c 6e 6f 64 65 29 2e | 68 65 69 67 68 74 20 2b |elnode).|height +|
|00001a20| 20 73 79 2c 6f 66 66 2e | 67 72 61 70 68 69 63 73 | sy,off.|graphics|
|00001a30| 2e 74 65 78 74 68 65 69 | 67 68 74 2b 35 29 0a 45 |.texthei|ght+5).E|
|00001a40| 6e 64 20 53 65 6c 65 63 | 74 07 6c 61 73 74 78 3d |nd Selec|t.lastx=|
|00001a50| 78 07 6c 61 73 74 79 3d | 79 09 6d 79 72 65 66 72 |x.lasty=|y.myrefr|
|00001a60| 65 73 68 06 65 6e 64 20 | 69 66 00 07 45 6e 64 20 |esh.end |if..End |
|00001a70| 53 75 62 09 4d 6f 75 73 | 65 44 6f 77 6e 0e 36 0e |Sub.Mous|eDown.6.|
|00001a80| 36 3b 39 46 75 6e 63 74 | 69 6f 6e 20 4d 6f 75 73 |6;9Funct|ion Mous|
|00001a90| 65 44 6f 77 6e 28 58 20 | 41 73 20 49 6e 74 65 67 |eDown(X |As Integ|
|00001aa0| 65 72 2c 20 59 20 41 73 | 20 49 6e 74 65 67 65 72 |er, Y As| Integer|
|00001ab0| 29 20 41 73 20 42 6f 6f | 6c 65 61 6e 10 64 69 6d |) As Boo|lean.dim|
|00001ac0| 20 69 20 61 73 20 69 6e | 74 65 67 65 72 00 07 6c | i as in|teger..l|
|00001ad0| 61 73 74 78 3d 78 07 6c | 61 73 74 79 3d 79 00 2f |astx=x.l|asty=y./|
|00001ae0| 69 66 20 73 65 6c 6e 6f | 64 65 20 3e 20 30 20 61 |if selno|de > 0 a|
|00001af0| 6e 64 20 54 69 63 6b 73 | 2d 6c 61 73 74 63 6c 69 |nd Ticks|-lastcli|
|00001b00| 63 6b 65 64 20 3c 3d 20 | 32 35 20 74 68 65 6e 1b |cked <= |25 then.|
|00001b10| 69 66 20 77 69 74 68 69 | 6e 4e 6f 64 65 28 73 65 |if withi|nNode(se|
|00001b20| 6c 6e 6f 64 65 29 20 74 | 68 65 6e 19 44 6f 75 62 |lnode) t|hen.Doub|
|00001b30| 6c 65 43 6c 69 63 6b 65 | 64 4e 6f 64 65 20 73 65 |leClicke|dNode se|
|00001b40| 6c 6e 6f 64 65 11 6c 61 | 73 74 63 6c 69 63 6b 65 |lnode.la|stclicke|
|00001b50| 64 3d 54 69 63 6b 73 0b | 72 65 74 75 72 6e 20 74 |d=Ticks.|return t|
|00001b60| 72 75 65 06 65 6e 64 20 | 69 66 06 65 6e 64 20 69 |rue.end |if.end i|
|00001b70| 66 00 36 69 66 20 65 64 | 69 74 6d 6f 64 65 20 61 |f.6if ed|itmode a|
|00001b80| 6e 64 20 73 65 6c 6e 6f | 64 65 20 3e 20 30 20 61 |nd selno|de > 0 a|
|00001b90| 6e 64 20 64 72 61 67 6e | 6f 64 65 28 73 65 6c 6e |nd dragn|ode(seln|
|00001ba0| 6f 64 65 29 20 74 68 65 | 6e 0b 72 65 74 75 72 6e |ode) the|n.return|
|00001bb0| 20 74 72 75 65 06 65 6e | 64 20 69 66 00 2f 69 66 | true.en|d if./if|
|00001bc0| 20 73 65 6c 6c 69 6e 6b | 20 3e 20 30 20 61 6e 64 | sellink| > 0 and|
|00001bd0| 20 54 69 63 6b 73 2d 6c | 61 73 74 63 6c 69 63 6b | Ticks-l|astclick|
|00001be0| 65 64 20 3c 3d 20 32 35 | 20 74 68 65 6e 1b 69 66 |ed <= 25| then.if|
|00001bf0| 20 77 69 74 68 69 6e 6c | 69 6e 6b 28 73 65 6c 6c | withinl|ink(sell|
|00001c00| 69 6e 6b 29 20 74 68 65 | 6e 19 44 6f 75 62 6c 65 |ink) the|n.Double|
|00001c10| 43 6c 69 63 6b 65 64 4c | 69 6e 6b 20 73 65 6c 6c |ClickedL|ink sell|
|00001c20| 69 6e 6b 11 6c 61 73 74 | 63 6c 69 63 6b 65 64 3d |ink.last|clicked=|
|00001c30| 54 69 63 6b 73 0b 72 65 | 74 75 72 6e 20 74 72 75 |Ticks.re|turn tru|
|00001c40| 65 06 65 6e 64 20 69 66 | 06 65 6e 64 20 69 66 00 |e.end if|.end if.|
|00001c50| 11 6c 61 73 74 63 6c 69 | 63 6b 65 64 3d 54 69 63 |.lastcli|cked=Tic|
|00001c60| 6b 73 00 18 66 6f 72 20 | 69 3d 31 20 74 6f 20 75 |ks..for |i=1 to u|
|00001c70| 62 6f 75 6e 64 28 6e 6f | 64 65 73 29 15 69 66 20 |bound(no|des).if |
|00001c80| 77 69 74 68 69 6e 4e 6f | 64 65 28 69 29 20 74 68 |withinNo|de(i) th|
|00001c90| 65 6e 09 73 65 6c 6e 6f | 64 65 3d 69 09 73 65 6c |en.selno|de=i.sel|
|00001ca0| 6c 69 6e 6b 3d 30 0e 6e | 6f 64 65 73 65 6c 65 63 |link=0.n|odeselec|
|00001cb0| 74 65 64 20 69 0b 72 65 | 74 75 72 6e 20 74 72 75 |ted i.re|turn tru|
|00001cc0| 65 04 65 78 69 74 06 65 | 6e 64 20 69 66 04 6e 65 |e.exit.e|nd if.ne|
|00001cd0| 78 74 00 18 66 6f 72 20 | 69 3d 31 20 74 6f 20 75 |xt..for |i=1 to u|
|00001ce0| 62 6f 75 6e 64 28 6c 69 | 6e 6b 73 29 15 69 66 20 |bound(li|nks).if |
|00001cf0| 77 69 74 68 69 6e 4c 69 | 6e 6b 28 69 29 20 74 68 |withinLi|nk(i) th|
|00001d00| 65 6e 09 73 65 6c 6c 69 | 6e 6b 3d 69 09 73 65 6c |en.selli|nk=i.sel|
|00001d10| 6e 6f 64 65 3d 30 09 6d | 79 72 65 66 72 65 73 68 |node=0.m|yrefresh|
|00001d20| 0e 6c 69 6e 6b 73 65 6c | 65 63 74 65 64 20 69 0b |.linksel|ected i.|
|00001d30| 72 65 74 75 72 6e 20 74 | 72 75 65 04 65 78 69 74 |return t|rue.exit|
|00001d40| 06 65 6e 64 20 69 66 04 | 6e 65 78 74 00 22 69 66 |.end if.|next."if|
|00001d50| 20 73 65 6c 6c 69 6e 6b | 20 3e 20 30 20 6f 72 20 | sellink| > 0 or |
|00001d60| 73 65 6c 6e 6f 64 65 20 | 3e 20 30 20 74 68 65 6e |selnode |> 0 then|
|00001d70| 09 73 65 6c 6c 69 6e 6b | 3d 30 09 73 65 6c 6e 6f |.sellink|=0.selno|
|00001d80| 64 65 3d 30 09 6d 79 72 | 65 66 72 65 73 68 06 65 |de=0.myr|efresh.e|
|00001d90| 6e 64 20 69 66 00 0b 72 | 65 74 75 72 6e 20 74 72 |nd if..r|eturn tr|
|00001da0| 75 65 00 00 0c 45 6e 64 | 20 46 75 6e 63 74 69 6f |ue...End| Functio|
|00001db0| 6e 04 4f 70 65 6e 0a 00 | 0a 00 1b 0a 53 75 62 20 |n.Open..|....Sub |
|00001dc0| 4f 70 65 6e 28 29 00 00 | 00 18 62 67 63 6f 6c 6f |Open()..|..bgcolo|
|00001dd0| 72 3d 72 67 62 28 32 30 | 30 2c 32 30 30 2c 32 30 |r=rgb(20|0,200,20|
|00001de0| 30 29 14 6c 69 6e 6b 63 | 6f 6c 6f 72 3d 72 67 62 |0).linkc|olor=rgb|
|00001df0| 28 30 2c 30 2c 30 29 14 | 6e 6f 64 65 63 6f 6c 6f |(0,0,0).|nodecolo|
|00001e00| 72 3d 72 67 62 28 30 2c | 30 2c 30 29 0f 6d 79 66 |r=rgb(0,|0,0).myf|
|00001e10| 6f 6e 74 3d 22 53 79 73 | 74 65 6d 22 00 1a 6c 69 |ont="Sys|tem"..li|
|00001e20| 6e 6b 74 65 78 74 63 6f | 6c 6f 72 3d 72 67 62 28 |nktextco|lor=rgb(|
|00001e30| 30 2c 30 2c 32 30 30 29 | 00 23 6e 65 61 74 6c 69 |0,0,200)|.#neatli|
|00001e40| 6e 6b 73 3d 74 72 75 65 | 20 2f 2f 64 72 61 77 20 |nks=true| //draw |
|00001e50| 22 73 6d 61 72 74 22 20 | 6c 69 6e 6b 73 00 00 14 |"smart" |links...|
|00001e60| 2f 2f 64 6f 6e 27 74 20 | 63 68 61 6e 67 65 20 62 |//don't |change b|
|00001e70| 65 6c 6f 77 1f 6f 66 66 | 3d 6e 65 77 70 69 63 74 |elow.off|=newpict|
|00001e80| 75 72 65 28 77 69 64 74 | 68 2c 68 65 69 67 68 74 |ure(widt|h,height|
|00001e90| 2c 31 36 29 12 27 6f 66 | 66 2e 74 72 61 6e 73 70 |,16).'of|f.transp|
|00001ea0| 61 72 65 6e 74 3d 31 00 | 19 73 65 6c 6e 6f 64 65 |arent=1.|.selnode|
|00001eb0| 3d 30 20 2f 2f 73 65 6c | 65 63 74 65 64 20 6e 6f |=0 //sel|ected no|
|00001ec0| 64 65 19 73 65 6c 6c 69 | 6e 6b 3d 30 20 2f 2f 73 |de.selli|nk=0 //s|
|00001ed0| 65 6c 65 63 74 65 64 20 | 6c 69 6e 6b 00 17 6f 66 |elected |link..of|
|00001ee0| 66 2e 67 72 61 70 68 69 | 63 73 2e 70 65 6e 77 69 |f.graphi|cs.penwi|
|00001ef0| 64 74 68 3d 32 18 6f 66 | 66 2e 67 72 61 70 68 69 |dth=2.of|f.graphi|
|00001f00| 63 73 2e 70 65 6e 68 65 | 69 67 68 74 3d 32 00 04 |cs.penhe|ight=2..|
|00001f10| 4f 70 65 6e 00 07 45 6e | 64 20 53 75 62 05 50 61 |Open..En|d Sub.Pa|
|00001f20| 69 6e 74 04 00 04 00 06 | 18 53 75 62 20 50 61 69 |int.....|.Sub Pai|
|00001f30| 6e 74 28 67 20 41 73 20 | 47 72 61 70 68 69 63 73 |nt(g As |Graphics|
|00001f40| 29 00 09 6d 79 72 65 66 | 72 65 73 68 00 00 07 45 |)..myref|resh...E|
|00001f50| 6e 64 20 53 75 62 00 00 | 00 |nd Sub..|. |
+--------+-------------------------+-------------------------+--------+--------+